// 取截单元,单位
export function moneyFormat (arg) {
  if (arg.toString().length >= 13) {
    // return arg/1000000000000+"万亿"
    const moneys = arg / 1000000000000
    const realVal = parseFloat(moneys).toFixed(2)
    return realVal + '万亿'
  } else if (arg.toString().length >= 9) {
    const moneys = arg / 100000000
    const realVal = parseFloat(moneys).toFixed(2)
    return realVal + '亿'
  } else if (arg.toString().length >= 4) {
    const moneys = arg / 10000
    const realVal = parseFloat(moneys).toFixed(2)
    return realVal + '万'
  }
}

export function group (array, subGroupLength) {
  let index = 0
  const newArray = []
  while (index < array.length) {
    newArray.push(array.slice(index, (index += subGroupLength)))
  }
  return newArray
}
